package com.itheima.demo;

import com.itheima.config.SpringConfig;
import com.itheima.pojo.User;
import com.itheima.srevice.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo1 {
    public static void main(String[] args) {
        ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService userService = ac.getBean(UserService.class);
        User u = userService.findOne(4);
        System.out.println(u);
    }
}
